package com.lyeducation.entities.course;

import com.lyeducation.entities.base.BaseEntity;
import com.lyeducation.enums.CourseCarouselEnum;
import com.lyeducation.enums.PopularCourseEnum;
import lombok.Data;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.List;

/**
 * 课程
 */
@Data
@Entity
@Table(name = "course")
public class CourseEntity extends BaseEntity {
    /**
     * 课程访问级别 0公开的
     */
    private int videoAccessRoleEnum;

    /**
     * 课程名称
     */
    private String name;

    /**
     * 课程说明
     */
    private String message;

    /**
     * 创建者id
     */
    private String createId;

    /**
     * 课程价格
     */
    private BigDecimal coursePrice;

    /**
     * 课程封面
     */
    private String coursePic;

    /**
     * 课程库存
     */
    private Integer courseStock;

    /**
     * 是否热推，默认为0不热推
     */
    private Integer isPopular = PopularCourseEnum.NO.getCode();

    /**
     * 是否轮播,默认为0不轮播
     */
    private Integer isCarousel = CourseCarouselEnum.NO.getCode();


    /**
     * 总评分
     */
    private int totalScore;

    /**
     * 评分人数
     */
    private int totalPeopleScoreSize;

    private List<ChapterEntity> chapterEntityList;

    @Transient
    public List<ChapterEntity> getChapterEntityList() {
        return chapterEntityList;
    }

    public void setChapterEntityList(List<ChapterEntity> chapterEntityList) {
        this.chapterEntityList = chapterEntityList;
    }
}
